{% extends 'leave/admin.html' %}
{% block content %}

<script type="text/javascript">
			app.controller('content',function ($scope,$http) {
				$scope.leave={
					empid:'{{empid}}'
				}
				$scope.name='{{name}}';
				$scope.save=function (b) {
					if(!b)return
					var postData = {
							submit_leave:$scope.leave,
						};  
					$http.post('',postData)
					.success(function(data, status, headers, config) {  
						alert('提交成功');
				    
					}).error(function(data, status, headers, config) {  
					    //处理错误 
					    $scope.std='有错误,返回码为:'+status;
					});
				}
					
			});
</script>

<div ng-controller='content'>
	<div><span ng-bind='name'></span></div>
	<form name="myForm" ng-submit="save(myForm.$valid)" novalidate>

		<!--<div class="form-group">
		    <label for="empid">员工号(测试用)</label>
		    <input type="text" class="form-control"  placeholder="员工号" name='empid' ng-model='leave.empid'>
	  	</div>-->

		<label for="">请假类型</label>

	  	<select class="form-control" ng-model='leave.category'>
		  <option value ="annual">年假</option>
		  <option value ="sick">病假</option>
		  <option value="personal">事假</option>
		  <option value="birthday">生日假</option>
		  <option value="other">其他</option>
		</select>
		<label for="">请假起止时间</label>
		<input type="datetime-local" name='start_time' ng-model='leave.start_time'>
		<input type="datetime-local" name='end_time' ng-model='leave.end_time'>
		<label for="reason">理由</label>
		<input type="text" name='reason' ng-model='leave.reason'>
		<input type="submit" value='提交'>
	</form>
</div>


{% endblock %}